<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', "BaseController@checkauthed");

Route::get('/login', function()
{
	return View::make('login')->with('title','登录');
});
Route::post('/login', "ProjectController@login");

Route::get('/signup', function()
{
	return View::make('signup')->with('title','注册');
});

Route::post('/signup', "ProjectController@signup");

Route::get('/index', array('before'=>'auth',function()
{
	return View::make('index')->with('title','主页');
}));

Route::get('/logout', "ProjectController@logout");

Route::group(array('prefix' => 'dashboard','before'=>'auth'), function(){
	Route::get('/xiaoshou', array('before'=>'auth',function()
	{
		return View::make('xiaoshou')->with('title','销售管理');
	}));
	Route::get('/cangku', array('before'=>'auth',function()
	{
		return View::make('cangku')->with('title','仓库管理');
	}));
	Route::get('/chaiwu', array('before'=>'auth',function()
	{
		return View::make('chaiwu')->with('title','财务管理');
	}));
	Route::get('/jingying', array('before'=>'auth',function()
	{
		return View::make('jingying')->with('title','经营管理');
	}));
	Route::get('/jichu', array('before'=>'auth','uses'=>'ProjectController@jichu'));
	Route::post('/jichu', array('before'=>'auth','uses'=>'ProjectController@jichupost'));
	Route::get('/gongsi', array('before'=>'auth','uses'=>'ProjectController@gongsi'));
	Route::get('/xitong', array('before'=>'auth',function()
	{
		return View::make('xitong')->with('title','系统维护');
	}));
	Route::get('/chexing', array('before'=>'auth',function()
	{
		return View::make('chexing')->with('title','车型管理');
	}));
	Route::get('/kehu', array('before'=>'auth',function()
	{
		return View::make('kehu')->with('title','客户管理');
	}));
	Route::get('/ywdingdan', array('before'=>'auth',function()
	{
		return View::make('ywdingdan')->with('title','客户管理');
	}));
	Route::get('/ywruku', array('before'=>'auth',function()
	{
		return View::make('ywruku')->with('title','客户管理');
	}));
	Route::get('/shengyu', array('before'=>'auth',function()
	{
		return View::make('shengyu')->with('title','剩余库存');
	}));
	Route::get('/yingkui', array('before'=>'auth',function()
	{
		return View::make('yingkui')->with('title','盈亏分析');
	}));
	Route::get('/weihu', array('before'=>'auth',function()
	{
		return View::make('weihu')->with('title','系统维护');
	}));
});		

Route::post("/postpinpai","ProjectController@postpinpai");
Route::post("/delpinpai","ProjectController@delpinpai");

Route::any("/getcompanys","ProjectController@getcompanys");
Route::any("/getcarslist","ProjectController@getcarslist");
Route::any("/addcar","ProjectController@addcar");
Route::any("/editecar","ProjectController@editecar");
Route::any("/deletecar","ProjectController@deletecar");

Route::any("/getcompanyslist","ProjectController@getcompanyslist");
Route::any("/addcompany","ProjectController@addcompany");
Route::any("/editecompany","ProjectController@editecompany");
Route::any("/deletecompany","ProjectController@deletecompany");

Route::any("/getclientslist","ProjectController@getclientslist");
Route::any("/addclient","ProjectController@addclient");
Route::any("/editeclient","ProjectController@editeclient");
Route::any("/deleteclient","ProjectController@deleteclient");
Route::any("/addorder","ProjectController@addorder");
Route::any("/getselldetail","ProjectController@getselldetail");
Route::any("/addselldetail","ProjectController@addselldetail");
Route::any("/editeselldetail","ProjectController@editeselldetail");
Route::any("/deleteselldetail","ProjectController@deleteselldetail");
Route::any("/getcars","ProjectController@getcars");


Route::any("/addinorder","ProjectController@addinorder");
Route::any("/getbuydetail","ProjectController@getbuydetail");
Route::any("/addbuydetail","ProjectController@addbuydetail");
Route::any("/editebuydetail","ProjectController@editebuydetail");
Route::any("/deletebuydetail","ProjectController@deletebuydetail");

Route::any("/getorderlist","ProjectController@getorderlist");


Route::any("/getinorderlist","ProjectController@getinorderlist");
Route::any("/getstore","ProjectController@getstore");
Route::any("/dbbackup.sql","ProjectController@dbbackup");
Route::any("/shieryuechengben","ProjectController@shieryuechengben");
Route::any("/shieryueyingshou","ProjectController@shieryueyingshou");
Route::any("/shieryuechexing","ProjectController@shieryuechexing");